from starlette.endpoints import HTTPEndpoint
from starlette.responses import JSONResponse
from database import Session, engine
import datetime
from dao import DaoWorkrecordProOther,DaoWorkRecord




class WorkrecordProOther(HTTPEndpoint):

    async def get(self, request):
        session = Session()
        try:
           return  DaoWorkrecordProOther.get_pro_other(session)
        finally:
            session.close()

class WorkrecordProOtherDetail(HTTPEndpoint):

    async def get(self, request):
        session = Session()
        try:
           bureauid = request.query_params["bureauid"]
           flag = request.query_params["flag"]
           return  DaoWorkRecord.get_pro_other_detail(session, bureauid, flag)
        finally:
            session.close()